import Vue from 'vue'
import VueRouter from 'vue-router'
// import Login from '../views/login/Index.vue'
Vue.use(VueRouter)

const routes = [
  // { path: '/login', component: Login }
  {
    path: '/',
    component: () => import('../views/layout/Index.vue'),
    children: [
      { path: '', component: () => import('../views/home/Index.vue'), meta: { keepAlive: true } },
      { path: '/qa', component: () => import('../views/qa/Index.vue') },
      { path: '/video', component: () => import('../views/video/Index.vue') },
      { path: '/my', component: () => import('../views/my/Index.vue') }
    ],
    meta: { keepAlive: true }
  },
  { path: '/login', component: () => import('../views/login/Index.vue') },
  { path: '/search', component: () => import('../views/search/Index.vue') },
  { path: '/article/:articleId', name: 'article', props: true, component: () => import('../views/article/Index.vue') },
  { path: '/user/profile', component: () => import('../views/user-profile/index.vue') }
]

const router = new VueRouter({
  routes
})

export default router
